# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2022年11月14日
"""
from docx import Document

document = Document()
section = document.sections[0]
header = section.header
print(header)
print(header.is_linked_to_previous)

# paragraph = header.paragraphs[0]
# paragraph.text = "Title of my document"

paragraph = header.paragraphs[0]
paragraph.text = "Left Text\tCenter Text\tRight Text"
paragraph.style = document.styles["Header"]

header.is_linked_to_previous = True
print(header.is_linked_to_previous)

document.save("08WorkingWithHeaderandFooter.docx")

